home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / OS2 / GNUSED.ZIP / sed / configure < prev    next >
Encoding:
Text File  |  1995-12-27  |  20.2 KB  |  843 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. echo > confdefs.h
  93. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  94.  
  95. # A filename unique to this package, relative to the directory that
  96. # configure is in, which we can look for to find out if srcdir is correct.
  97. unique_file=sed.c
  98.  
  99. # Find the source files, if location was not specified.
  100. if test -z "$srcdir"; then
  101.   srcdirdefaulted=yes
  102.   # Try the directory containing this script, then `..'.
  103.   prog=$0
  104.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  105.   test "X$confdir" = "X$prog" && confdir=.
  106.   srcdir=$confdir
  107.   if test ! -r $srcdir/$unique_file; then
  108.     srcdir=..
  109.   fi
  110. fi
  111. if test ! -r $srcdir/$unique_file; then
  112.   if test x$srcdirdefaulted = xyes; then
  113.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  114.   else
  115.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  116.   fi
  117.   exit 1
  118. fi
  119. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  120. # But we can't avoid them for `..', to make subdirectories work.
  121. case $srcdir in
  122.   .|/*|~*) ;;
  123.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  124. esac
  125.  
  126.  
  127. # Save the original args to write them into config.status later.
  128. configure_args="$*"
  129.  
  130. if test -z "$CC"; then
  131.   # Extract the first word of `gcc', so it can be a program name with args.
  132.   set dummy gcc; word=$2
  133.   echo checking for $word
  134.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  135.   for dir in $PATH; do
  136.     test -z "$dir" && dir=.
  137.     if test -f $dir/$word; then
  138.       CC="gcc"
  139.       break
  140.     fi
  141.   done
  142.   IFS="$saveifs"
  143. fi
  144. test -z "$CC" && CC="cc"
  145. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  146.  
  147. # Find out if we are using GNU C, under whatever name.
  148. cat > conftest.c <<EOF
  149. #ifdef __GNUC__
  150.   yes
  151. #endif
  152. EOF
  153. ${CC-cc} -E conftest.c > conftest.out 2>&1
  154. if egrep yes conftest.out >/dev/null 2>&1; then
  155.   GCC=1 # For later tests.
  156. fi
  157. rm -f conftest*
  158.  
  159. echo checking how to run the C preprocessor
  160. if test -z "$CPP"; then
  161.   # This must be in double quotes, not single quotes, because CPP may get
  162.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  163.   # make.  It must be expanded now.
  164.   CPP="${CC-cc} -E"
  165.   cat > conftest.c <<EOF
  166. #include "confdefs.h"
  167. #include <stdio.h>
  168. Syntax Error
  169. EOF
  170. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  171. if test -z "$err"; then
  172.   :
  173. else
  174.   rm -rf conftest*
  175.   CPP=/lib/cpp
  176. fi
  177. rm -f conftest*
  178. fi
  179. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  180.  
  181. # Make sure to not get the incompatible SysV /etc/install and
  182. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  183. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  184. # or the AFS install, which mishandles nonexistent args, or
  185. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  186. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  187. # anyway.  Sigh.
  188. if test "z${INSTALL}" = "z" ; then
  189.   echo checking for install
  190.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  191.   for dir in $PATH; do
  192.     test -z "$dir" && dir=.
  193.     case $dir in
  194.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  195.     *)
  196.       if test -f $dir/installbsd; then
  197.     INSTALL="$dir/installbsd -c" # OSF1
  198.     INSTALL_PROGRAM='$(INSTALL)'
  199.     INSTALL_DATA='$(INSTALL) -m 644'
  200.     break
  201.       fi
  202.       if test -f $dir/install; then
  203.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  204.       : # AIX
  205.     else
  206.       INSTALL="$dir/install -c"
  207.       INSTALL_PROGRAM='$(INSTALL)'
  208.       INSTALL_DATA='$(INSTALL) -m 644'
  209.       break
  210.     fi
  211.       fi
  212.       ;;
  213.     esac
  214.   done
  215.   IFS="$saveifs"
  216. fi
  217. INSTALL=${INSTALL-cp}
  218. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  219. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  220. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  221. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  222. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  223.  
  224. echo checking for minix/config.h
  225. cat > conftest.c <<EOF
  226. #include "confdefs.h"
  227. #include <minix/config.h>
  228. EOF
  229. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  230. if test -z "$err"; then
  231.   rm -rf conftest*
  232.   MINIX=1
  233.  
  234. fi
  235. rm -f conftest*
  236.  
  237. # The Minix shell can't assign to the same variable on the same line!
  238. if test -n "$MINIX"; then
  239.   
  240. {
  241. test -n "$verbose" && \
  242. echo "    defining _POSIX_SOURCE"
  243. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  244. DEFS="$DEFS -D_POSIX_SOURCE=1"
  245. }
  246.  
  247.   
  248. {
  249. test -n "$verbose" && \
  250. echo "    defining" _POSIX_1_SOURCE to be 2
  251. echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
  252. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  253. }
  254.  
  255.   
  256. {
  257. test -n "$verbose" && \
  258. echo "    defining _MINIX"
  259. echo "#define" _MINIX 1 >> confdefs.h
  260. DEFS="$DEFS -D_MINIX=1"
  261. }
  262.  
  263. fi
  264.  
  265. echo checking for POSIXized ISC
  266. if test -d /etc/conf/kconfig.d &&
  267.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  268. then
  269.   ISC=1 # If later tests want to check for ISC.
  270.   
  271. {
  272. test -n "$verbose" && \
  273. echo "    defining _POSIX_SOURCE"
  274. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  275. DEFS="$DEFS -D_POSIX_SOURCE=1"
  276. }
  277.  
  278.   if test -n "$GCC"; then
  279.     CC="$CC -posix"
  280.   else
  281.     CC="$CC -Xp"
  282.   fi
  283. fi
  284.  
  285. echo checking for ANSI C header files
  286. cat > conftest.c <<EOF
  287. #include "confdefs.h"
  288. #include <stdlib.h>
  289. #include <stdarg.h>
  290. #include <string.h>
  291. #include <float.h>
  292. EOF
  293. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  294. if test -z "$err"; then
  295.   rm -rf conftest*
  296.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  297. echo '#include "confdefs.h"
  298. #include <string.h>' > conftest.c
  299. eval "$CPP conftest.c > conftest.out 2>&1"
  300. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  301.   rm -rf conftest*
  302.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  303. cat > conftest.c <<EOF
  304. #include "confdefs.h"
  305. #include <ctype.h>
  306. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  307. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  308. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  309. int main () { int i; for (i = 0; i < 256; i++)
  310. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  311. exit (0); }
  312.  
  313. EOF
  314. eval $compile
  315. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  316.   rm -rf conftest*
  317.   
  318. {
  319. test -n "$verbose" && \
  320. echo "    defining STDC_HEADERS"
  321. echo "#define" STDC_HEADERS 1 >> confdefs.h
  322. DEFS="$DEFS -DSTDC_HEADERS=1"
  323. }
  324.  
  325.  
  326. fi
  327. rm -f conftest*
  328.  
  329. fi
  330. rm -f conftest*
  331.  
  332.  
  333. fi
  334. rm -f conftest*
  335.  
  336. for hdr in string.h
  337. do
  338. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  339. echo checking for ${hdr}
  340. cat > conftest.c <<EOF
  341. #include "confdefs.h"
  342. #include <${hdr}>
  343. EOF
  344. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  345. if test -z "$err"; then
  346.   rm -rf conftest*
  347.   
  348. {
  349. test -n "$verbose" && \
  350. echo "    defining ${trhdr}"
  351. echo "#define" ${trhdr} 1 >> confdefs.h
  352. DEFS="$DEFS -D${trhdr}=1"
  353. }
  354.  
  355.  
  356. fi
  357. rm -f conftest*
  358. done
  359.  
  360. echo checking for vprintf
  361. cat > conftest.c <<EOF
  362. #include "confdefs.h"
  363.  
  364. int main() { exit(0); }
  365. int t() { vprintf(); }
  366. EOF
  367. if eval $compile; then
  368.   rm -rf conftest*
  369.   
  370. {
  371. test -n "$verbose" && \
  372. echo "    defining HAVE_VPRINTF"
  373. echo "#define" HAVE_VPRINTF 1 >> confdefs.h
  374. DEFS="$DEFS -DHAVE_VPRINTF=1"
  375. }
  376.  
  377.  
  378. else
  379.   rm -rf conftest*
  380.   vprintf_missing=1
  381. fi
  382. rm -f conftest*
  383.  
  384. if test -n "$vprintf_missing"; then
  385. echo checking for _doprnt
  386. cat > conftest.c <<EOF
  387. #include "confdefs.h"
  388.  
  389. int main() { exit(0); }
  390. int t() { _doprnt(); }
  391. EOF
  392. if eval $compile; then
  393.   rm -rf conftest*
  394.   
  395. {
  396. test -n "$verbose" && \
  397. echo "    defining HAVE_DOPRNT"
  398. echo "#define" HAVE_DOPRNT 1 >> confdefs.h
  399. DEFS="$DEFS -DHAVE_DOPRNT=1"
  400. }
  401.  
  402.  
  403. fi
  404. rm -f conftest*
  405.  
  406. fi
  407.  
  408. for func in bcopy memcpy
  409. do
  410. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  411. echo checking for ${func}
  412. cat > conftest.c <<EOF
  413. #include "confdefs.h"
  414. #include <ctype.h>
  415. int main() { exit(0); }
  416. int t() { 
  417. /* The GNU C library defines this for functions which it implements
  418.     to always fail with ENOSYS.  Some functions are actually named
  419.     something starting with __ and the normal name is an alias.  */
  420. #if defined (__stub_${func}) || defined (__stub___${func})
  421. choke me
  422. #else
  423. /* Override any gcc2 internal prototype to avoid an error.  */
  424. extern char ${func}(); ${func}();
  425. #endif
  426.  }
  427. EOF
  428. if eval $compile; then
  429.   rm -rf conftest*
  430.   {
  431. test -n "$verbose" && \
  432. echo "    defining ${trfunc}"
  433. echo "#define" ${trfunc} 1 >> confdefs.h
  434. DEFS="$DEFS -D${trfunc}=1"
  435. }
  436.  
  437.  
  438. fi
  439. rm -f conftest*
  440. done
  441.  
  442. prog='/* Ultrix mips cc rejects this.  */
  443. typedef int charset[2]; const charset x;
  444. /* SunOS 4.1.1 cc rejects this.  */
  445. char const *const *ccp;
  446. char **p;
  447. /* AIX XL C 1.02.0.0 rejects this.
  448.    It does not let you subtract one const X* pointer from another in an arm
  449.    of an if-expression whose if-part is not a constant expression */
  450. const char *g = "string";
  451. ccp = &g + (g ? g-g : 0);
  452. /* HPUX 7.0 cc rejects these. */
  453. ++ccp;
  454. p = (char**) ccp;
  455. ccp = (char const *const *) p;
  456. { /* SCO 3.2v4 cc rejects this.  */
  457.   char *t;
  458.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  459.  
  460.   *t++ = 0;
  461. }
  462. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  463.   int x[] = {25,17};
  464.   const int *foo = &x[0];
  465.   ++foo;
  466. }
  467. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  468.   typedef const int *iptr;
  469.   iptr p = 0;
  470.   ++p;
  471. }
  472. { /* AIX XL C 1.02.0.0 rejects this saying
  473.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  474.   struct s { int j; const int *ap[3]; };
  475.   struct s *b; b->j = 5;
  476. }'
  477. echo checking for lack of working const
  478. cat > conftest.c <<EOF
  479. #include "confdefs.h"
  480.  
  481. int main() { exit(0); }
  482. int t() { $prog }
  483. EOF
  484. if eval $compile; then
  485.   :
  486. else
  487.   rm -rf conftest*
  488.   
  489. {
  490. test -n "$verbose" && \
  491. echo "    defining" const to be empty
  492. echo "#define" const  >> confdefs.h
  493. DEFS="$DEFS -Dconst="
  494. }
  495.  
  496. fi
  497. rm -f conftest*
  498.  
  499. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  500. # for constant arguments.  Useless!
  501. echo checking for working alloca.h
  502. cat > conftest.c <<EOF
  503. #include "confdefs.h"
  504. #include <alloca.h>
  505. int main() { exit(0); }
  506. int t() { char *p = alloca(2 * sizeof(int)); }
  507. EOF
  508. if eval $compile; then
  509.   rm -rf conftest*
  510.   
  511. {
  512. test -n "$verbose" && \
  513. echo "    defining HAVE_ALLOCA_H"
  514. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  515. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  516. }
  517.  
  518.  
  519. fi
  520. rm -f conftest*
  521.  
  522. decl="#ifdef __GNUC__
  523. #define alloca __builtin_alloca
  524. #else
  525. #if HAVE_ALLOCA_H
  526. #include <alloca.h>
  527. #else
  528. #ifdef _AIX
  529.  #pragma alloca
  530. #else
  531. char *alloca ();
  532. #endif
  533. #endif
  534. #endif
  535. "
  536. echo checking for alloca
  537. cat > conftest.c <<EOF
  538. #include "confdefs.h"
  539. $decl
  540. int main() { exit(0); }
  541. int t() { char *p = (char *) alloca(1); }
  542. EOF
  543. if eval $compile; then
  544.   :
  545. else
  546.   rm -rf conftest*
  547.   alloca_missing=1
  548. cat > conftest.c <<EOF
  549. #include "confdefs.h"
  550.  
  551. #if defined(CRAY) && ! defined(CRAY2)
  552. winnitude
  553. #else
  554. lossage
  555. #endif
  556.  
  557. EOF
  558. eval "$CPP conftest.c > conftest.out 2>&1"
  559. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  560.   rm -rf conftest*
  561.   echo checking for _getb67
  562. cat > conftest.c <<EOF
  563. #include "confdefs.h"
  564. #include <ctype.h>
  565. int main() { exit(0); }
  566. int t() { 
  567. /* The GNU C library defines this for functions which it implements
  568.     to always fail with ENOSYS.  Some functions are actually named
  569.     something starting with __ and the normal name is an alias.  */
  570. #if defined (__stub__getb67) || defined (__stub____getb67)
  571. choke me
  572. #else
  573. /* Override any gcc2 internal prototype to avoid an error.  */
  574. extern char _getb67(); _getb67();
  575. #endif
  576.  }
  577. EOF
  578. if eval $compile; then
  579.   rm -rf conftest*
  580.   {
  581. test -n "$verbose" && \
  582. echo "    defining" CRAY_STACKSEG_END to be _getb67
  583. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  584. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  585. }
  586.  
  587.  
  588. else
  589.   rm -rf conftest*
  590.   echo checking for GETB67
  591. cat > conftest.c <<EOF
  592. #include "confdefs.h"
  593. #include <ctype.h>
  594. int main() { exit(0); }
  595. int t() { 
  596. /* The GNU C library defines this for functions which it implements
  597.     to always fail with ENOSYS.  Some functions are actually named
  598.     something starting with __ and the normal name is an alias.  */
  599. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  600. choke me
  601. #else
  602. /* Override any gcc2 internal prototype to avoid an error.  */
  603. extern char GETB67(); GETB67();
  604. #endif
  605.  }
  606. EOF
  607. if eval $compile; then
  608.   rm -rf conftest*
  609.   {
  610. test -n "$verbose" && \
  611. echo "    defining" CRAY_STACKSEG_END to be GETB67
  612. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  613. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  614. }
  615.  
  616.  
  617. else
  618.   rm -rf conftest*
  619.   echo checking for getb67
  620. cat > conftest.c <<EOF
  621. #include "confdefs.h"
  622. #include <ctype.h>
  623. int main() { exit(0); }
  624. int t() { 
  625. /* The GNU C library defines this for functions which it implements
  626.     to always fail with ENOSYS.  Some functions are actually named
  627.     something starting with __ and the normal name is an alias.  */
  628. #if defined (__stub_getb67) || defined (__stub___getb67)
  629. choke me
  630. #else
  631. /* Override any gcc2 internal prototype to avoid an error.  */
  632. extern char getb67(); getb67();
  633. #endif
  634.  }
  635. EOF
  636. if eval $compile; then
  637.   rm -rf conftest*
  638.   {
  639. test -n "$verbose" && \
  640. echo "    defining" CRAY_STACKSEG_END to be getb67
  641. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  642. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  643. }
  644.  
  645.  
  646. fi
  647. rm -f conftest*
  648.  
  649. fi
  650. rm -f conftest*
  651.  
  652. fi
  653. rm -f conftest*
  654.  
  655.  
  656. fi
  657. rm -f conftest*
  658.  
  659.  
  660. fi
  661. rm -f conftest*
  662.  
  663. if test -n "$alloca_missing"; then
  664.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  665.   # that cause trouble.  Some versions do not even contain alloca or
  666.   # contain a buggy version.  If you still want to use their alloca,
  667.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  668.   ALLOCA=alloca.o
  669.   
  670. {
  671. test -n "$verbose" && \
  672. echo "    defining C_ALLOCA"
  673. echo "#define" C_ALLOCA 1 >> confdefs.h
  674. DEFS="$DEFS -DC_ALLOCA=1"
  675. }
  676.  
  677.  
  678.   echo 'checking stack direction for C alloca'
  679.   echo checking whether cross-compiling
  680. # If we cannot run a trivial program, we must be cross compiling.
  681. cat > conftest.c <<EOF
  682. #include "confdefs.h"
  683. main(){exit(0);}
  684. EOF
  685. eval $compile
  686. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  687.   :
  688. else
  689.   rm -rf conftest*
  690.   cross_compiling=1
  691. fi
  692. rm -f conftest*
  693.  
  694. if test -n "$cross_compiling"
  695. then
  696.   
  697. {
  698. test -n "$verbose" && \
  699. echo "    defining" STACK_DIRECTION to be 0
  700. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  701. DEFS="$DEFS -DSTACK_DIRECTION=0"
  702. }
  703.  
  704. else
  705. cat > conftest.c <<EOF
  706. #include "confdefs.h"
  707. find_stack_direction ()
  708. {
  709.   static char *addr = 0;
  710.   auto char dummy;
  711.   if (addr == 0)
  712.     {
  713.       addr = &dummy;
  714.       return find_stack_direction ();
  715.     }
  716.   else
  717.     return (&dummy > addr) ? 1 : -1;
  718. }
  719. main ()
  720. {
  721.   exit (find_stack_direction() < 0);
  722. }
  723. EOF
  724. eval $compile
  725. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  726.   rm -rf conftest*
  727.   
  728. {
  729. test -n "$verbose" && \
  730. echo "    defining" STACK_DIRECTION to be 1
  731. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  732. DEFS="$DEFS -DSTACK_DIRECTION=1"
  733. }
  734.  
  735.  
  736. else
  737.   rm -rf conftest*
  738.   
  739. {
  740. test -n "$verbose" && \
  741. echo "    defining" STACK_DIRECTION to be -1
  742. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  743. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  744. }
  745.  
  746. fi
  747. fi
  748. rm -f conftest*
  749. fi
  750.  
  751. # Set default prefixes.
  752. if test -n "$prefix"; then
  753.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  754.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  755. fi
  756. if test -n "$exec_prefix"; then
  757.   prsub="$prsub
  758. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  759. fi
  760. # Quote sed substitution magic chars in DEFS.
  761. cat >conftest.def <<EOF
  762. $DEFS
  763. EOF
  764. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  765. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  766. rm -f conftest.def
  767. # Substitute for predefined variables.
  768.  
  769. trap 'rm -f config.status; exit 1' 1 3 15
  770. echo creating config.status
  771. rm -f config.status
  772. cat > config.status <<EOF
  773. #!/bin/sh
  774. # Generated automatically by configure.
  775. # Run this file to recreate the current configuration.
  776. # This directory was configured as follows,
  777. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  778. #
  779. # $0 $configure_args
  780.  
  781. for arg
  782. do
  783.   case "\$arg" in
  784.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  785.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  786.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  787.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  788.   esac
  789. done
  790.  
  791. trap 'rm -f Makefile; exit 1' 1 3 15
  792. CC='$CC'
  793. CPP='$CPP'
  794. INSTALL='$INSTALL'
  795. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  796. INSTALL_DATA='$INSTALL_DATA'
  797. ALLOCA='$ALLOCA'
  798. LIBS='$LIBS'
  799. srcdir='$srcdir'
  800. DEFS='$DEFS'
  801. prefix='$prefix'
  802. exec_prefix='$exec_prefix'
  803. prsub='$prsub'
  804. extrasub='$extrasub'
  805. EOF
  806. cat >> config.status <<\EOF
  807.  
  808. top_srcdir=$srcdir
  809.  
  810. CONFIG_FILES=${CONFIG_FILES-"Makefile"}
  811. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  812.   srcdir=$top_srcdir
  813.   # Remove last slash and all that follows it.  Not all systems have dirname.
  814.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  815.   if test "$dir" != "$file"; then
  816.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  817.     test ! -d $dir && mkdir $dir
  818.   fi
  819.   echo creating $file
  820.   rm -f $file
  821.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  822.   sed -e "
  823. $prsub
  824. $extrasub
  825. s%@CC@%$CC%g
  826. s%@CPP@%$CPP%g
  827. s%@INSTALL@%$INSTALL%g
  828. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  829. s%@INSTALL_DATA@%$INSTALL_DATA%g
  830. s%@ALLOCA@%$ALLOCA%g
  831. s%@LIBS@%$LIBS%g
  832. s%@srcdir@%$srcdir%g
  833. s%@DEFS@%$DEFS%
  834. " $top_srcdir/${file}.in >> $file
  835. fi; done
  836.  
  837.  
  838. exit 0
  839. EOF
  840. chmod +x config.status
  841. ${CONFIG_SHELL-/bin/sh} config.status
  842.  
  843.